<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- <link rel="icon" href="../../../../favicon.ico"> -->
    
    <title>登录</title>

    <!-- Bootstrap core CSS -->
    <!-- <link href="../../../../dist/css/bootstrap.min.css" rel="stylesheet"> -->
    <link href="${rc.contextPath}/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="${rc.contextPath}/css/floating-labels.css" rel="stylesheet">
    <!--swal提示框需要的样式-->
    <script type="text/javascript" language="javascript" src="${rc.contextPath}/js/sweetalert.min.js"></script>
    <link rel="stylesheet" href="${rc.contextPath}/css/sweetalert.css">
    <script type="text/javascript" language="javascript" src="${rc.contextPath}/vendor/jquery/jquery.min.js"></script>
  </head>

  <body>
  

    <form class="form-signin" id="userForm">
      <!-- <div class="text-center mb-4">
        <img class="mb-4" src="https://getbootstrap.com/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
        <h1 class="h3 mb-3 font-weight-normal">Floating labels</h1>
        <p>Build form controls with floating labels via the <code>:placeholder-shown</code> pseudo-element. <a href="https://caniuse.com/#feat=css-placeholder-shown">Works in latest Chrome, Safari, and Firefox.</a></p>
      </div> -->
      <!--
      <div class="form-label-group">
        <input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
        <label for="inputEmail">Email address</label>
      </div>
      -->
      	<div class="text-center form-label-group" style="color:green">
			<h2 class="title-text">退役军人信息管理系统</h2>
		</div>
		<br/>
      <div class="form-label-group">
        <input type="text" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
        <label for="inputEmail">用户名</label>
      </div>

      <div class="form-label-group">
        <input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
        <label for="inputPassword">密码</label>
      </div>

      <div class="checkbox mb-3">
        <label>
          <input type="checkbox" value="remember-me">记住我
        </label>
      </div>
      <button class="btn btn-lg btn-primary btn-block" type="button" onclick="login()">登录</button>
      <p class="mt-5 mb-3 text-muted text-center">&copy; 2018-2030</p>
    </form>
  </body>
  <script type="text/javascript">
  function login(){
	  debugger;
	  var username = $("#inputEmail").val();
	  var pwd = $("#inputPassword").val();
	 $.ajax({
		 type:"post",
		 url :"/user/doLogin?inputEmail="+username+"&inputPassword="+pwd,
		 success:function(data){
			 if(data.code=="0"){
				 if(data.user.power_id=="1"){
					 window.location.href = "/user/index_main1";
				 }else if(data.user.power_id=="2"){
					 window.location.href = "/user/index_main2";
				 }else {
					 window.location.href = "/user/index_main3";
				 }
			 }else if(data.code=="1"){
				 alert("密码错误");
				 swal("密码错误");
			 }else if(data.code=="2"){
				 alert("账号不存在");
			 }
		 }
	 })
	  
  }
  </script>
</html>
